const baseURL = 'http://localhost:3005/api'



export const get = async (url:string)=>{
  const res = await fetch(`${baseURL}${url}`)
  const data = res.json()
  return data
}

export const post = async (url:string, body:any)=>{
  const res = await fetch(`${baseURL}${url}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(body)
  })
  const data = res.json()
  return data
}